#ifndef  _MAN_H_
#define  _MAN_H_

#include "cocos2d.h"
USING_NS_CC;
class  Man : public cocos2d::CCSprite
{
	enum DIRECTION{
		DOWN		= 0,
		LEFT			,
		RIGHT			,
		UP				,
		LEFTDOWN		,
		RIGHTDOWN		,
		LEFTUP			,
		RIGHTUP			,
	};
	enum STATUS{
		STOP		= 0,
		WALKING			,
		DIED
	};
public:
	Man();
	~Man();
	int Init();
	void Walk(const CCPoint& end_pos);
	void Stop();
	inline void ChangeDestination(const CCPoint& end_pos){
		end_pos_ = end_pos;
	}
	int ChangeDirection(const CCPoint& end_pos);
	void Step();
private:
	void StopStep();
private:
	DIRECTION direction_;
	STATUS man_status_;
	CCPoint end_pos_;
	bool pressed_;

	unsigned short left_right_step_;

	CCAnimation* work_animation_[8];
	CCAnimation* work_animation__[8][2];
};

#endif // _MAN_H_

